package test;

import java.awt.Image;
import java.awt.Toolkit;
import java.util.Calendar;
import java.util.GregorianCalendar;

public class Chatter_Util {
	public static String getCurrentTime(){
		 Calendar calendar = new GregorianCalendar();
		  String am_pm;
		  int hour = calendar.get(Calendar.HOUR);
		  int minute = calendar.get(Calendar.MINUTE);
		  int second = calendar.get(Calendar.SECOND);
		  if(calendar.get(Calendar.AM_PM) == 0)
		  am_pm = "AM";
		  else
		  am_pm = "PM";
		  return   hour + ":" 
		+ minute + ":" + second + " " + am_pm;
	}
	
	public static Image getImage(String path){
		return Toolkit.getDefaultToolkit().getImage(RunServer.class.getResource(path));
	}
}
